Performance improvements: tunes sysctl configuration and adds many tunnels per interface#19
Open
Performance improvements: tunes sysctl configuration and adds many tunnels per interface#19
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
vproxtunnels are notably slow. In an experiment using iperf3, they produced the following results:vproxis ~4x slower for uploads and ~7x slower for downloads.Some overhead from encryption is expected when using WireGuard, particularly if the CPU is saturated with encryption or decryption operations. However, a difference this large is unacceptable.
With the changes in this PR, a
vproxinterface achieves the following throughput in the same experiment:Uploads reach 3.94 Gbps (80% of baseline) and downloads reach 4.30 Gbps (36% of baseline). This represents a 4x improvement in upload speed and a 2.5x improvement in download speed over the previous version. Both are currently bottlenecked by server CPU utilization — adding more resources will increase throughput further.
This is achieved through two improvements:
sysctlperformance tuning that configures the Linux kernel to use RX/TX queuesThe client now accepts a
--tunnels Nparameter, whereNis the number of tunnels to start. The client creates a dummy interface that routes traffic across all tunnels in round-robin fashion.Backwards compatibility is preserved when the parameter is omitted or when passing
--tunnels 1.